﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Sistema_Test_OnLine.Logic;

namespace Sistema_Test_OnLine.Presentacion
{
    public partial class Banco_Preguntas : System.Web.UI.Page
    {
        string tipo;

        public string Tipo
        {
            get { return tipo; }
            set { tipo = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            string cad = this.txt_buscar_preguntas.Text.Trim();
            string criterio = this.txt_buscar_preguntas.Text.Trim();
            Facade.GetPregunta(criterio);
            GridView1.DataBind();

        }
        protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
        {
            int row = GridView1.SelectedIndex;
            Session["row"] = row;
            Session["idpregunta"] = int.Parse(GridView1.Rows[row].Cells[0].Text);
            //Label1.Text = "" + row;
            if (GridView1.Rows[row].Cells[2].Text.Equals("Unica Respuesta"))
            {

                Response.Redirect("~/Presentacion/Edit_Pre_op_Unica.aspx");
            }
            if (GridView1.Rows[row].Cells[2].Text.Equals("Multiple Respuesta"))
            {

                Response.Redirect("~/Presentacion/Edit_Pre_op_Multiple.aspx");
            }
            if (GridView1.Rows[row].Cells[2].Text.Equals("Completar"))
            {

                Response.Redirect("~/Presentacion/Edit_Pre_op_Completar.aspx");
            }

        }
        
    }
}